package top.jacktgq.candychat.netty.pojo.dto;

import top.jacktgq.candychat.pojo.ChatMsg;

import java.io.Serializable;

/**
 * 
 * @Title: DataContent.java 
 * @Package top.jacktgq.imooc.candychat 
 * @Description: Netty消息传输对象
 * @author CandyWall   
 * @date 2021年2月22日 下午8:31:07 
 * @version V1.0
 */
public class DataContentDTO implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 6191151036542280847L;
    
    private Integer action;         // 动作类型
    private ChatMsgDTO chatMsgDTO;  // 用户的聊天内容
    private String extend;          // 扩展字段

    public DataContentDTO() {
    }

    public DataContentDTO(Integer action) {
        this(action, null, null);
    }

    public DataContentDTO(Integer action, ChatMsgDTO chatMsgDTO) {
        this(action, chatMsgDTO, null);
    }

    public DataContentDTO(Integer action, ChatMsgDTO chatMsgDTO, String extend) {
        this.action = action;
        this.chatMsgDTO = chatMsgDTO;
        this.extend = extend;
    }

    public Integer getAction() {
        return action;
    }
    public void setAction(Integer action) {
        this.action = action;
    }

    public ChatMsgDTO getChatMsgDTO() {
        return chatMsgDTO;
    }

    public void setChatMsgDTO(ChatMsgDTO chatMsgDTO) {
        this.chatMsgDTO = chatMsgDTO;
    }

    public String getExtend() {
        return extend;
    }
    public void setExtend(String extend) {
        this.extend = extend;
    }

    @Override
    public String toString() {
        return "DataContentDTO{" +
                "action=" + action +
                ", chatMsgDTO=" + chatMsgDTO +
                ", extend='" + extend + '\'' +
                '}';
    }
}
